#ifndef TRANSFORM_HPP
#define TRANSFORM_HPP

#include "Common.hpp"

/*
 *           y (yaw)
 *           |
 *           |
 *           |
 *           |
 *           *---------- x (pitch)
 *          /
 *         /
 *        /
 *       z (roll)
 */

class Transform
{
public:
  /**
   * Produces a model matrix m = T*Ry*Rx*Rz
   * 
   * @param translation  The translation vector
   * @param rotation     The pitch yaw and roll respectively.
   */
  Transform(const glm::vec3 & translation = glm::vec3(0.0f, 0.0f, 0.0f),
            const glm::vec3 & rotation = glm::vec3(0.0f, 0.0f, 0.0f));
  Transform(const glm::mat4 & matrix);
  
  glm::mat4 getModelMatrix();
  
  void transform(const glm::vec3 & displacement,
                 const glm::vec3 & rotation);
  void set(const glm::vec3 & displacement,
                 const glm::vec3 & rotation);
  void setModelMatrix(const mat4 & mat) {m_modelMatrix = mat;}
  
  glm::vec3 getTranslation() const;
  glm::mat4 getTranslationMatrix() const;
  glm::vec2 getRotation() const;
private:
  
  glm::vec3  m_rotation; // Pitch .x, Yaw .y, Roll .z
  
  glm::mat4  m_modelMatrix;
  
  glm::mat4  m_translationMatrix;

  
};

#endif // TRANSFORM_HPP
